//---------------------------------------------------------------------------

#ifndef MainSFH
#define MainSFH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <System.Win.ScktComp.hpp>
#include "AdvGlowButton.hpp"
#include <Vcl.ExtCtrls.hpp>
#include <Data.DB.hpp>
#include <Data.Win.ADODB.hpp>
//---------------------------------------------------------------------------
class TMain : public TForm
{
__published:	// IDE-managed Components
	TServerSocket *srv;
	TMemo *eLog;
	TEdit *ePort;
	TLabel *lblPort;
	TEdit *eTest;
	TButton *btn1;
	TButton *btnRun;
	TLabel *lblTimelbl;
	TLabel *lblTime;
	TADOConnection *gpsdb;
	TEdit *eCol;
	TLabel *lblCollbl;
	TADOQuery *qSave;
	TLabel *lblIp;
	TEdit *eIp;
	TLabel *lblServerPort;
	TEdit *eServerPort;
	TLabel *lblLogin;
	TLabel *lblPass;
	TEdit *eLogin;
	TEdit *ePass;
	TButton *btnConnect;
	TLabel *lblWorkTimelbl;
	TLabel *lblWorkTime;
	TLabel *lblCountlbl;
	TLabel *lblCount;
	TLabel *lblUdellbl;
	TLabel *lblUdel;
	TCheckBox *chkInf;
	TLabel *lblCountTotallbl;
	TLabel *lblCountTotal;
	TMemo *ePackets;
	TCheckBox *chkPakcets;
	TLabel *lblRawlbl;
	TLabel *lblRaw;
	TLabel *lblIgnoredlbl;
	TLabel *lblIgnored;
	TMemo *eError;
	TLabel *lblError;
	TCheckBox *chkClose;
	TComboBox *eIMEI;
	TComboBox *eRemoteIp;
	void __fastcall btnRunClick(TObject *Sender);
	void __fastcall srvClientRead(TObject *Sender, TCustomWinSocket *Socket);
	void __fastcall btn1Click(TObject *Sender);
	void __fastcall btnConnectClick(TObject *Sender);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall srvClientError(TObject *Sender, TCustomWinSocket *Socket, TErrorEvent ErrorEvent,
          int &ErrorCode);


private:	// User declarations
public:		// User declarations
	__fastcall TMain(TComponent* Owner);
	bool bRun;
	String sPrior;
	String __fastcall Parsing(AnsiString sStr,String sIP);
	void __fastcall SaveToDb();
	int iWorkBegin,iWorkEnd;
	int iRaw;
};
//---------------------------------------------------------------------------
extern PACKAGE TMain *Main;
//---------------------------------------------------------------------------
#endif
